<%= link_to("<< Back to Admin List", admin_index_path, :class => 'back-link') %>

<div class='page-header'>
  <h2>Edit <%= resource_name.to_s.humanize %></h2>
</div>

<div class="col-xs-6 col-sm-8">
  <%= error_messages_for resource %>
  <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>

    <div><%= f.label :username %><br />
    <%= f.text_field :username, :autofocus => true, class: "form-control" %></div>

    <div><%= f.label :name %><br/>
    <%= f.text_field :name, class: "form-control" %></div>

    <div><%= f.label :email %><br />
    <%= f.email_field :email, class: "form-control" %></div>

    <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
      <div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
    <% end %>

    <div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
    <%= f.password_field :password, :autocomplete => "off", class: "form-control" %></div>

    <div><%= f.label :password_confirmation %><br />
    <%= f.password_field :password_confirmation, :autocomplete => "off", class: "form-control" %></div>

    <div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
    <%= f.password_field :current_password, :autocomplete => "off", class: "form-control" %></div>

    <div><%= f.submit "Update", class: 'btn btn-primary' %></div>
  <% end %>
</div>